<?php
require 'common.php';
$id = $_GET['id'];
require"templates/edit.html";

if ($_POST) {
    $title = $_POST['title'];
    $content = $_POST['content'];
    $time = time();
    mysql_query("update `article` set `title`='$title', `content`='$content', `time`='$time' where `id`='$id'");
//    echo "<script>alert('修改成功');location.href='index.php'</script>";//输出‘修改成功‘，并回转到index.php页面。
    jump('index.php','修改成功');
}